import request from '@/utils/request'

export default {
  getList(params) {
    return request({
      url: '/v1/adminList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/admin/${id}`,
      method: 'get'
    })
  },
  update(data) {
    return request({
      url: '/v1/adminUpdate',
      method: 'post',
      data
    })
  },
  create(data) {
    return request({
      url: '/v1/adminAdd',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/adminDel/${id}`,
      method: 'get'
    })
  },
  tree() {
    return request({
      url: `/v1/departmentTree`,
      method: 'get'
    })
  },
  userInfo(data) {
    return request({
      url: '/v1/userInfo',
      method: 'post',
      data
    })
  },
  changePassword(data) {
    return request({
      url: '/v1/adminChangePassword',
      method: 'post',
      data
    })
  },
  excel(data) {
    return request({
      url: '/v1/adminImport',
      method: 'post',
      data
    })
  },
  append(data) {
    return request({
      url: '/v1/appendRole',
      method: 'post',
      data
    })
  }
}
